home *** CD-ROM | disk | FTP | other *** search
- Path: pacifica.access.ch!usenet
- From: tombeck@usemail.com (Thomas Beck)
- Newsgroups: comp.lang.c
- Subject: Re: Please please help a newbie!!
- Date: 16 Feb 1996 23:36:18 GMT
- Organization: Internet Access AG, Zuerich, Switzerland
- Message-ID: <4g34di$mg0@pacifica.access.ch>
- References: <4fth5k$43v@pacifica.access.ch>
- NNTP-Posting-Host: gatezh2-16.access.ch
- X-Newsreader: NeoLogic News for OS/2 [version: 4.2]
-
- In message <4g01js$h6q@sun001.spd.dsccc.com> - jmccarty@spd.dsccc.com (Mike McC
- arty) writes:
-
- >)----------- example 1: -------------
- >)int i;
- >)int & a=i;
- > ^ If you are trying to declare a pointer to
- > an integer, and set it to point to i, then you need this line:
- >
- > int *a = &i;
-
- I have to apologize for posting to the wrong group. I've realized that my
- problems are C++ specific. If I had thought about it, I should have known.
- int & a=i means that a is a reference of i, so whenever you change a, i gets
- the same value.
-
- >)----------- example 2: -------------
- >)struct abc {
- >) int i;
- >) char a;
- >) void f1() {
- > ^ If you are trying to declare a pointer
- > to a function returning void, then you need
- > void *f1();
- > no "{}" are needed.
-
- It just means a function within a class. Also this is possible in C++.
-
- Now why did my C++ compiler not compile it? Because I had named the file
- test.c instead of test.cpp. Gee, I never thought a program could rely that
- much on an extension! I mean, if I tell my computer "scc test.c", and scc is
- a C++ compiler, shouldn't it just do it? Oh well... :-)
-
- Thomas Beck, tombeck@usemail.com
-
- =================================================================
- Summer's day, as she passed away. Birds were singing in the
- summer sky; then came the rain, and once again, a tear fell
- from her mother's eye...
- =================================================================
-
-